{include file="public/header"/}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><b class="pcfts">*</b>复制到栏目</label>
                            <div class="layui-input-inline">
                                <select id="typeid" name="typeid">
                                    {$arctype_html|raw}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="aids" id="aids" value="">
                                <button class="layui-btn" lay-submit lay-filter="formSubmit">确认提交</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer"/}
<script>
  layui.use(['layer', 'form'], function () {
    var $ = layui.$,
    layer = layui.layer,
    form = layui.form;

    var parentObj = parent.layer.getFrameIndex(window.name);
    $('#aids').val(parent.get_aids());

    //监听提交
    form.on('submit(formSubmit)', function(data){
        layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
        $.ajax({
            type : "post",
            url : "{:url('/content/batch_move')}",
            data : data.field,
            dataType : 'json',
            success : function(res){
                layer.closeAll();
                if(res.status){
                    parent.layer.msg(res.msg, {shade: 0.3, time: 1000}, function(){
                        parent.window.location.href = res.url;
                        parent.layer.close(parentObj);
                    });
                }else{
                    layer.msg(res.msg, {icon: 2, time: 1000});
                }
            },
            error: function(e){
                layer.closeAll();
                layer.msg("未知错误，操作中断！", {icon: 2, time: 1000});
            }
        });
    });

  });
</script>